package com.Maykk.Demo01;

import java.util.HashSet;
import java.util.Random;
import java.util.TreeSet;

/**
 * @ClassName: Demo03
 * @Description: TODO Set 集合 双色球
 * @Author: MaykkStar@163.com
 */
public class Demo03 {
    public static void main(String[] args) {
        // TreeSet 有序
        TreeSet<Integer> redBalls = new TreeSet<>();
        // HashSet 无序
        // HashSet<Integer> redBalls = new HashSet<>();
        Random ran = new Random();
        while (redBalls.size() < 6) {
            redBalls.add(ran.nextInt(33) + 1);
        }
        int blueBall = ran.nextInt(16) + 1;
        System.out.println("红球：" + redBalls + ", 蓝球：[" + blueBall + "]");
    }
}
